package com.example.demo13.controllers;


import com.example.demo13.config.School;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.*;


@Controller
public class IndexController {

    public IndexController(School school) {
        this.school = school;
    }

    @RequestMapping( "/say")
   @ResponseBody
   public String sayString(){
       return "say springboot";
   }
    @Value("${webPath}")
    public String webPath;
    @RequestMapping( "/mapvalue")
    public @ResponseBody Map mapvalue(){
        Map<String,Object> retMap=new HashMap<String, Object>() ;
         retMap.put("message","Springboot1");
        List<String> list1=new ArrayList<>();
        list1.add("1list");
        System.out.println(list1);
          System.out.println(webPath);
         return retMap;
    }
    @Autowired
    private  School school;

    @RequestMapping("/school")
    public @ResponseBody String school(){
        return "11"+school.getName();
    }

}
